package com.xc.pattern.command;

/**
 * @author xingchen
 * @description
 * @create 2022-09-07 20:51
 */
public class AppInvoker {

    private Command onCommand;

    private Command offCommand;

    private Command coolCommand;

    private Command warmCommand;

    public Command getOnCommand() {
        return onCommand;
    }

    public void setOnCommand(Command onCommand) {
        this.onCommand = onCommand;
    }

    public Command getOffCommand() {
        return offCommand;
    }

    public void setOffCommand(Command offCommand) {
        this.offCommand = offCommand;
    }

    public Command getCoolCommand() {
        return coolCommand;
    }

    public void setCoolCommand(Command coolCommand) {
        this.coolCommand = coolCommand;
    }

    public Command getWarmCommand() {
        return warmCommand;
    }

    public void setWarmCommand(Command warmCommand) {
        this.warmCommand = warmCommand;
    }

    /**
     * 开机
     */
    public void on() {
        onCommand.execute();
    }

    /**
     * 关机
     */
    public void off() {
        offCommand.execute();
    }

    /**
     * 制冷
     */
    public void cool() {
        coolCommand.execute();
    }

    /**
     * 制暖
     */
    public void warm() {
        warmCommand.execute();
    }


}
